package world.liquor.domain;

public class SubCode {
	private String subcodeKey;
	private String subcodeValue;
	private String subcodeExplanation;
	private String commonCodeKey;
	public SubCode(String subcodeKey, String subcodeValue,
			String subcodeExplanation, String codeKey) {
		this.subcodeKey = subcodeKey;
		this.subcodeValue = subcodeValue;
		this.subcodeExplanation = subcodeExplanation;
		this.commonCodeKey = commonCodeKey;
	}
	public SubCode() {
	}
	public String getSubcodeKey() {
		return subcodeKey;
	}
	public void setSubcodeKey(String subcodeKey) {
		this.subcodeKey = subcodeKey;
	}
	public String getSubcodeValue() {
		return subcodeValue;
	}
	public void setSubcodeValue(String subcodeValue) {
		this.subcodeValue = subcodeValue;
	}
	public String getSubcodeExplanation() {
		return subcodeExplanation;
	}
	public void setSubcodeExplanation(String subcodeExplanation) {
		this.subcodeExplanation = subcodeExplanation;
	}
	public String getCodeKey() {
		return commonCodeKey;
	}
	public void setCodeKey(String codeKey) {
		this.commonCodeKey = codeKey;
	}
	@Override
	public String toString() {
		return "subCode [subcodeKey=" + subcodeKey + ", subcodeValue="
				+ subcodeValue + ", subcodeExplanation=" + subcodeExplanation
				+ ", codeKey=" + commonCodeKey + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((commonCodeKey == null) ? 0 : commonCodeKey.hashCode());
		result = prime
				* result
				+ ((subcodeExplanation == null) ? 0 : subcodeExplanation
						.hashCode());
		result = prime * result
				+ ((subcodeKey == null) ? 0 : subcodeKey.hashCode());
		result = prime * result
				+ ((subcodeValue == null) ? 0 : subcodeValue.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SubCode other = (SubCode) obj;
		if (commonCodeKey == null) {
			if (other.commonCodeKey != null)
				return false;
		} else if (!commonCodeKey.equals(other.commonCodeKey))
			return false;
		if (subcodeExplanation == null) {
			if (other.subcodeExplanation != null)
				return false;
		} else if (!subcodeExplanation.equals(other.subcodeExplanation))
			return false;
		if (subcodeKey == null) {
			if (other.subcodeKey != null)
				return false;
		} else if (!subcodeKey.equals(other.subcodeKey))
			return false;
		if (subcodeValue == null) {
			if (other.subcodeValue != null)
				return false;
		} else if (!subcodeValue.equals(other.subcodeValue))
			return false;
		return true;
	}
	
}
